Ext.define('Admin.view.overtimefile.OvertimeFileForm', {
    extend: 'Ext.form.Panel',
    id:'overtimeFileForm',
    alias: 'widget.overtimeFileForm',
    requires: [
    	'Ext.layout.container.Anchor',
    	'Ext.layout.container.Column',
        'Ext.button.Button',
        'Ext.form.field.Text',
        'Ext.form.field.File',
        'Ext.form.field.HtmlEditor',
		'Ext.form.field.TextArea',
		'Ext.form.field.Time',
		'Ext.form.field.ComboBox',
		'Ext.form.field.Date',
		'Ext.form.field.Radio',
		'Ext.form.field.Hidden'
    ],
    //viewModel: {type: 'emailcompose'},
    //cls: 'email-compose',
    controller: 'overtimeFileViewController',
	
	scrollable:true,
	
    bodyStyle:'padding:5px 5px 0',
    width: "100%",
    fieldDefaults: {
        labelAlign: 'top',
        msgTarget: 'qtip',
        allowBlank:false,
        blankText:'该项不能为空'
    },

    items: [{
        xtype: 'container',
        anchor: '100%',
        layout:'column',
        items:[{
            xtype:'hidden',
            name:'id'
        },{
            xtype:'hidden',
            name:'userId',
            value:userId
        },{
            xtype:'hidden',
            name:'taskId'
        },{
            xtype: 'container',
            columnWidth:.5,
            layout: 'anchor',
            items: [{
                id:'name',
                xtype:'textfield',
                fieldLabel: '申请人',
                readOnly:true,
                name: 'name',
                anchor:'96%'
            }, {
                xtype:'textfield',
                fieldLabel: '所属部门',
                readOnly:true,
                name: 'department',
                anchor:'96%'
            }]
        },{
            xtype: 'container',
            columnWidth:.5,
            layout: 'anchor',
            items: [{
                xtype:'datefield',
                fieldLabel: '实际加班日期',
                name: 'realOvertimeDate',
                format:'Y/m/d',
                anchor:'100%'
            },{
                id:'begin',
                xtype:'timefield',
                fieldLabel: '实际开始时间',
                name: 'realBeginTime',
                format: 'H:i',
                increment: 30,
                anchor:'100%',
                value:'0:00',
                listeners:{
                    blur: function(){
                        var end=Ext.getCmp('end');
                        end.setMinValue(this.value);
                    } 
                }
            },{
                id:'end',
                xtype:'timefield',
                fieldLabel: '实际结束时间',
                increment: 30,
                format: 'H:i',
                maxValue:'24:00',
                name: 'realEndTime',
                anchor:'100%'
            }]
        }]
    }],
    bbar: {
        items: ['->',{
			xtype: 'button',
			//ui: 'soft-red',
			text: '提交',
			handler: 'overtimeFileFormSubmit'
		},{
			xtype: 'button',
			//ui: 'gray',
			text: '取消',
			handler: 'closeWindow'
		}]
    }
});